<?php

use think\facade\Route;

/** 接口路由 */

// 课程分类
Route::group('admin/category', function () {
    Route::get('/list$', '@getList'); // 课程分类列表
    Route::get('/<id>/children$', '@getChildren')->pattern(['id' => '\d+']); // 课程分类列表
    Route::post('/create$', '@createCategory'); // 添加课程分类
    Route::put('/<id>$', '@editCategory')->pattern(['id' => '\d+']); // 编辑课程分类
    Route::delete('/<id>$', '@deleteCategory')->pattern(['id' => '\d+']); // 删除课程分类
    Route::get('/cascader', '@getTree');// 树形结构
})->prefix('\app\common\service\category\admin\Category')->append(['category_type' => 0])->middleware(['adminRoute']);
